package com.wwwarehouse.contract.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhenwang.xiang on 2017/10/18.
 * Description:
 */

public class ProductDetailsBean implements Parcelable {


    /**
     * list : [{"img":"测试内容dpzz","originPrice":229,"rsName":"测试资源名称","rsQty":1,"rsUnit":"U01"}]
     * page : 1
     * size : 10
     * total : 1
     */

    private int page;
    private int size;
    private int total;
    private ArrayList<ListBean> list;

    public void setPage(int page) {
        this.page = page;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public void setList(ArrayList<ListBean> list) {
        this.list = list;
    }

    public int getPage() {
        return page;
    }

    public int getSize() {
        return size;
    }

    public int getTotal() {
        return total;
    }

    public ArrayList<ListBean> getList() {
        return list;
    }

    public static class ListBean implements Parcelable {
        /**
         * img : 测试内容dpzz
         * originPrice : 229
         * rsName : 测试资源名称
         * rsQty : 1
         * rsUnit : U01
         */

        private String img;
        private String originPrice;
        private String rsName;
        private int rsQty;
        private String rsUnit;

        public void setImg(String img) {
            this.img = img;
        }

        public void setOriginPrice(String originPrice) {
            this.originPrice = originPrice;
        }

        public void setRsName(String rsName) {
            this.rsName = rsName;
        }

        public void setRsQty(int rsQty) {
            this.rsQty = rsQty;
        }

        public void setRsUnit(String rsUnit) {
            this.rsUnit = rsUnit;
        }

        public String getImg() {
            return img;
        }

        public String getOriginPrice() {
            return originPrice;
        }

        public String getRsName() {
            return rsName;
        }

        public int getRsQty() {
            return rsQty;
        }

        public String getRsUnit() {
            return rsUnit;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.img);
            dest.writeString(this.originPrice);
            dest.writeString(this.rsName);
            dest.writeInt(this.rsQty);
            dest.writeString(this.rsUnit);
        }

        public ListBean() {
        }

        protected ListBean(Parcel in) {
            this.img = in.readString();
            this.originPrice = in.readString();
            this.rsName = in.readString();
            this.rsQty = in.readInt();
            this.rsUnit = in.readString();
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            public ListBean createFromParcel(Parcel source) {
                return new ListBean(source);
            }

            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.page);
        dest.writeInt(this.size);
        dest.writeInt(this.total);
        dest.writeList(this.list);
    }

    public ProductDetailsBean() {
    }

    protected ProductDetailsBean(Parcel in) {
        this.page = in.readInt();
        this.size = in.readInt();
        this.total = in.readInt();
        this.list = new ArrayList<ListBean>();
        in.readList(this.list, List.class.getClassLoader());
    }

    public static final Parcelable.Creator<ProductDetailsBean> CREATOR = new Parcelable.Creator<ProductDetailsBean>() {
        public ProductDetailsBean createFromParcel(Parcel source) {
            return new ProductDetailsBean(source);
        }

        public ProductDetailsBean[] newArray(int size) {
            return new ProductDetailsBean[size];
        }
    };
}
